<template>
  <div :attri="handle" class="container">
    <el-table :data="tableData" border style="width: 200%">
      <el-table-column fixed prop="id" label="id" width="100">
      </el-table-column>
      <el-table-column prop="name" label="姓名" width="120"> </el-table-column>
      <el-table-column prop="sex" label="性别" width="100">
      </el-table-column>
      <el-table-column prop="email" label="邮箱" width="200"> </el-table-column>
      <el-table-column prop="phoneNumber" label="电话" width="180">
      </el-table-column>
      <el-table-column prop="wechat" label="微信" width="120"> </el-table-column>
      <el-table-column prop="qq" label="qq" width="120"> </el-table-column>
      <el-table-column prop="province" label="省份" width="120"> </el-table-column>
      <el-table-column prop="city" label="城市" width="120"> </el-table-column>
      <el-table-column prop="address" label="详细地址" width="120"> </el-table-column>
      <el-table-column fixed="right" label="操作" width="100">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small"
            >查看</el-button
          >
          <el-button type="text" size="small">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

export default {
  data() {
    return {
      name: 123,
      tableData: null
    };
  },
  computed: {
    handle() {
      console.log(this.$route, this.$router);
      return this.$route;
    },
  },
  created() {
      console.log('111');
      let self_this = this;
    this.$axios.get('/getCustoms').then(function(res){
        self_this.tableData = res.data;
        console.log(self_this.tableData,111);
    });
  },
  methods: {
      handleClick(row) {
        console.log(row);
      }
    },
};
</script>

<style>
.container{
    width: 1400px;
}
</style>